package com.shgsh.common.util;
import com.shgsh.common.repository.BasicRepository;
import org.aspectj.lang.annotation.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 切面控制数据库关闭
 * Created by jessy on 2015/8/4.
 */
@Aspect
public class Interceptor4SSDB {
    Logger logger = LoggerFactory.getLogger(Interceptor4SSDB.class);


    @Autowired
    BasicRepository basicRepository;

    public void doAccessCheck(){
        logger.debug("进行数据库操作");
    }

    public void doAfterReturning(){
        logger.debug("数据库操作完成");
    }

    public void doAfter(){
        basicRepository.closeConnect();
    }
}
